<?php
	// Load the QCubed Development Framework
	require('../qcubed.inc.php');
        require("SampleCtl.class.php");

    class TestCtl extends QForm {
        protected $txtValue1;
        protected $ctlSample;
        protected $ctlSample2;
        protected $ctlSample3;

         public function Reverse($strParameter){
            $ObjOrg = Org::LoadByName($strParameter);
            return $ObjOrg->Id;
        }
        public function A_Change($strParameter){
            $array = "2,3,4,5,6";
            $objMemberArray = Org::QueryArray(
                                              QQ::AndCondition(
                                                            QQ::Equal(QQN::Org()->TypeId, $array),
                                                            QQ::Like(QQN::Org()->Name, $strParameter . '%')
                                                 ),
                                                 QQ::Clause(QQ::OrderBy(QQN::Org()->Name))
                                            );
            return $objMemberArray;
        }
        // Define all the QContrtol objects for our Calculator
        protected function Form_Create() {
            $a= new QDateTime();
            $a->setDate(1982, 8, 27);
            $a->setTime(8, 46, 0);
            $this->ctlSample3 = new QDateTimeC($this);
            $this->ctlSample3->Name = "Date";
            
            $this->ctlSample3->__set("DateTime" , $a);
            
            $this->txtValue1 = new QTextBox($this);

            $this->ctlSample = new AutoCompleteList($this) ;
            $this->ctlSample->strCallList = "A_Change";
            $this->ctlSample->strReverseCall = "Reverse";
            $this->ctlSample->bolDuplicate = false;
            $this->ctlSample->lst->AddItem("asdad");

            $this->ctlSample2 = new QButton($this) ;
            $this->ctlSample2->Text = "Click";
            $this->ctlSample2->AddAction(new QClickEvent(), new QServerAction('btnGetList_Click'));
            //$this->ctlSample2->Name = "The Panel";


	}
         public function btnGetList_Click(){

            $x= $this->ctlSample3->__get('DateTime') ;
             QApplication::ExecuteJavaScript("alert('$x');");
         }


     }
     TestCtl::Run('TestCtl',"samplecontrol.tpl.php");
?>

